<?php
namespace app\index\controller;
use think\facade\Db;
use think\facade\View;

class Cate{
    public function cate()
    {
        $yiji=Db::table('ecm_category')->where("parentid=0")->order('sort','asc')->select();
        $erji=Db::table('ecm_category')->select();
        $zid=Db::name('category')->column('parentid');

        View::assign('zid',$zid);
        View::assign('erji',$erji);
        View::assign('yiji',$yiji);
        return View();
    }

    public function cateEdit()
    {
        return View();
    }
    public function cateEr()
    {
        $id = input('id');
        $erji=Db::table('ecm_category')->where('parentid','=',"{$id}")->select();
        View::assign('erji',$erji);
        return View();
    }
}